package com.hqq.behaviour.specification.selector;

import com.hqq.behaviour.specification.creature.Creature;
import com.hqq.behaviour.specification.property.Color;

import java.util.function.Predicate;

/**
 * ColorSelector
 * Created by heqianqian on 2017/6/20.
 */
public class ColorSelector implements Predicate<Creature> {

    private final Color color;

    public ColorSelector(Color color) {
        this.color = color;
    }

    @Override
    public boolean test(Creature creature) {
        return creature.getColor().equals(color);
    }
}
